<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:p="http://primefaces.org/ui"
                template="/templates/ui.xhtml">

    <ui:define name="head">
        <script type="text/javascript" src="#{request.contextPath}/UI/support/pub.js"/>
        <script type="text/javascript" language="javascript">
            document.onkeydown = function TabReplace() {
                if (event.keyCode == 13) {
                    if (event.srcElement.tagName != 'BUTTON')
                        event.keyCode = 9;
                    else
                        event.srcElement.click();
                }
            }
            function actSelect(obj) {
                var pkid = obj;
                var sfeature = "dialogwidth:1300px;dialogheight:700px;center:yes;location:no;help:no;resizable:no;scroll:yes;status:no";
                var arg = new Object();
                arg.doType = "select";

                var strCallPageNameFlag = document.getElementById("form:hiCallPageNameFlag").value;
                if (strCallPageNameFlag == "SubcttStlEngPQry") {
                    var rtn = dialog("../item/itemHieRelapQry_SubcttEngPStl.xhtml?strEsInitStlSubcttEng=" + pkid + "", arg, sfeature);
                }
                if (strCallPageNameFlag == "SubcttStlEngPPrint") {
                    var rtn = dialog("../item/itemHieRelapMng_SubcttEngPStl.xhtml?strEsInitStlSubcttEng=" + pkid + "", arg, sfeature);
                }
            }
        </script>

        <style type="text/css">
            .img {
                width: 20px;
                height: 30px;
            }

            .c_c {
                background: gray;
            }
        </style>
    </ui:define>
    <ui:define name="content">
        <div style="margin:5px;">
            <h:form id="form" enctype="multipart/form-data">
                <p:growl id="msgs" showDetail="true"/>
                <p:panel id="ppCondition" header="分包合同价格_结算信息查询" style="width: 100%">
                </p:panel>

                <h:inputHidden id="hiCallPageNameFlag"
                               value="#{esInitSubcttStlPAction.strCallPageNameFlag}"></h:inputHidden>

                <p:ajaxStatus style="width:16px;height:16px;">
                    <f:facet name="start">
                        <h:graphicImage value="/images/ajaxloading.gif"/>
                    </f:facet>
                    <f:facet name="complete">
                        <h:outputText value=""/>
                    </f:facet>
                </p:ajaxStatus>

                <!--列表维护-->
                <p:contextMenu for="pdt">
                    <p:menuitem value="详细内容" icon="ui-icon-search"
                                oncomplete="actSelect(DtInitSubcttList.selection)">
                    </p:menuitem>
                </p:contextMenu>
                <p:dataTable id="pdt" style="width:100%;"
                             value="#{esInitSubcttStlPAction.itemEsInitStlList}"
                             var="record"
                             rowKey="#{record.pkid}"
                             selection="#{esInitSubcttStlPAction.itemEsInitStlSelected}"
                             selectionMode="single"
                             paginatorTemplate="{FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                             paginator="true"
                             paginatorPosition="bottom"
                             rows="15"
                             rowsPerPageTemplate="100,50,30,15,5"
                             emptyMessage="数据记录为空..."
                             widgetVar="DtInitSubcttList"
                             rowStyleClass="#{record.statusFlag eq '4'?'c_c': null}">

                    <p:column headerText="pkid" style="display:none;" rendered="false">
                        <h:outputText id="tetid" style="display:none;" rendered="false" value="#{record.pkid}"/>
                    </p:column>

                    <p:column headerText="结算编号" style="text-align:center">
                        <h:outputText value="#{record.id}"/>
                    </p:column>

                    <p:column headerText="分包合同" style="text-align:left">
                        <h:outputText value="#{record.name}"/>
                    </p:column>

                    <p:column headerText="协作单位" style="text-align:left">
                        <h:outputText value="#{record.signPartBName}"/>
                    </p:column>

                    <p:column headerText="期数编码" style="text-align:center">
                        <h:outputText value="#{record.periodNo}"/>
                    </p:column>

                    <p:column headerText="状态" style="width:66px;text-align:center">
                        <h:outputText value="#{esPowerAction.getLabelByValueInStatusFlaglist(record.statusFlag)}"/>
                    </p:column>

                    <p:column headerText="原因" style="width:66px;text-align:center">
                        <h:outputText
                                value="#{esPowerAction.getLabelByValueInPreStatusFlaglist(record.preStatusFlag)}"/>
                    </p:column>

                    <p:column headerText="结束标志" style="width:66px;text-align:center">
                        <h:outputText value="#{esPowerAction.getLabelByValueInEndFlagList(record.endFlag)}"/>
                    </p:column>
                </p:dataTable>
            </h:form>
        </div>
    </ui:define>
</ui:composition>